home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / gfxIImageFrame.idl < prev    next >
Text File  |  2006-05-08  |  7KB  |  217 lines

  1. /** -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * ***** BEGIN LICENSE BLOCK *****
  4.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5.  *
  6.  * The contents of this file are subject to the Mozilla Public License Version
  7.  * 1.1 (the "License"); you may not use this file except in compliance with
  8.  * the License. You may obtain a copy of the License at
  9.  * http://www.mozilla.org/MPL/
  10.  *
  11.  * Software distributed under the License is distributed on an "AS IS" basis,
  12.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13.  * for the specific language governing rights and limitations under the
  14.  * License.
  15.  *
  16.  * The Original Code is mozilla.org code.
  17.  *
  18.  * The Initial Developer of the Original Code is
  19.  * Netscape Communications Corporation.
  20.  * Portions created by the Initial Developer are Copyright (C) 2001
  21.  * the Initial Developer. All Rights Reserved.
  22.  *
  23.  * Contributor(s):
  24.  *   Stuart Parmenter <pavlov@netscape.com>
  25.  *   Chris Saari <saari@netscape.com>
  26.  *
  27.  * Alternatively, the contents of this file may be used under the terms of
  28.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  29.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  30.  * in which case the provisions of the GPL or the LGPL are applicable instead
  31.  * of those above. If you wish to allow use of your version of this file only
  32.  * under the terms of either the GPL or the LGPL, and not to allow others to
  33.  * use your version of this file under the terms of the MPL, indicate your
  34.  * decision by deleting the provisions above and replace them with the notice
  35.  * and other provisions required by the GPL or the LGPL. If you do not delete
  36.  * the provisions above, a recipient may use your version of this file under
  37.  * the terms of any one of the MPL, the GPL or the LGPL.
  38.  *
  39.  * ***** END LICENSE BLOCK ***** */
  40.  
  41. #include "nsISupports.idl"
  42. #include "gfxtypes.idl"
  43. #include "gfxIFormats.idl"
  44.  
  45. %{C++
  46. #include "nsRect.h"
  47. %}
  48.  
  49. native nsRectRef(nsIntRect &);
  50.  
  51. /**
  52.  * gfxIImageFrame interface
  53.  *
  54.  * All x, y, width, height values are in pixels.
  55.  *
  56.  * @author Tim Rowley <tor@cs.brown.edu>
  57.  * @author Stuart Parmenter <pavlov@netscape.com>
  58.  * @version 0.1
  59.  */
  60. [scriptable, uuid(f6d00ee7-defc-4101-b2dc-e72cf4c37c3c)]
  61. interface gfxIImageFrame : nsISupports
  62. {
  63.   /**
  64.    * Create a new \a aWidth x \a aHeight sized image.
  65.    *
  66.    * @param aX The x-offset from the origin of the gfxIImageContainer parent.
  67.    * @param aY The y-offset from the origin of the gfxIImageContainer parent.
  68.    * @param aWidth The width of the image to create.
  69.    * @param aHeight The height of the image to create.
  70.    * @param aFormat the width of the image to create.
  71.    *
  72.    * @note The data of a new image is unspecified (Whats the word i'm looking for here?).
  73.    */
  74.   void init(in PRInt32 aX,
  75.             in PRInt32 aY,
  76.             in PRInt32 aWidth,
  77.             in PRInt32 aHeight,
  78.             in gfx_format aFormat,
  79.             in gfx_depth aDepth);
  80.  
  81.   /**
  82.    * TRUE by default.  When set to FALSE, you will no longer be able to make any modifications
  83.    * to the data of the image.  Any attempts will fail.
  84.    */
  85.   attribute boolean mutable;
  86.  
  87.   /**
  88.    * The x-offset of the image.
  89.    */
  90.   readonly attribute PRInt32 x;
  91.  
  92.   /**
  93.    * The y-offset of the image.
  94.    */
  95.   readonly attribute PRInt32 y;
  96.  
  97.   /**
  98.    * The width of the image.
  99.    */
  100.   readonly attribute PRInt32 width;
  101.  
  102.   /**
  103.    * The height of the image.
  104.    */
  105.   readonly attribute PRInt32 height;
  106.  
  107.   /**
  108.    * The rectangle this frame ocupies.
  109.    * @param rect this is really an out parameter.
  110.    */
  111.   [noscript] void getRect(in nsRectRef rect);
  112.  
  113.   /**
  114.    * The image data format the image was created with.
  115.    * @see gfxIFormats
  116.    */
  117.   readonly attribute gfx_format format;
  118.  
  119.   /**
  120.    * returns whether the image requires the background to be painted
  121.    */
  122.   readonly attribute boolean needsBackground;
  123.  
  124.   /* data accessors */
  125.   readonly attribute unsigned long imageBytesPerRow;
  126.  
  127.   /**
  128.    * returns the number of bytes allocated for the image
  129.    */
  130.   readonly attribute unsigned long imageDataLength;
  131.  
  132.   // XXX do we copy here?  lets not...
  133.   void getImageData([array, size_is(length)] out PRUint8 bits, out unsigned long length);
  134.  
  135.   /**
  136.    * Sets \a length bytes of \a data in this object.
  137.    * @param offset The offset from the first pixel in bytes.  To set
  138.    *   data beginning with the first (top left) pixel in the image, \a offset
  139.    *   should be 0; to set data beginning with, for example, the sixth pixel in
  140.    *   the first row of a RGBA32 image, the offset should be 20.
  141.    * @attension should we use PRUint32 instead?
  142.    */
  143.   void setImageData([array, size_is(length), const] in PRUint8 data,
  144.                     in unsigned long length,
  145.                     in long offset);
  146.  
  147.   /**
  148.    * Lock image pixels before addressing the data directly
  149.    */
  150.   void lockImageData();
  151.  
  152.   /**
  153.    * Unlock image pixels
  154.    */
  155.   void unlockImageData();
  156.  
  157.  
  158.  
  159.   /* alpha stuff.. used for _A1 and _A8 formated images */
  160.   readonly attribute unsigned long alphaBytesPerRow;
  161.  
  162.   /**
  163.    * returns the number of bytes allocated for the alpha mask
  164.    */
  165.   readonly attribute unsigned long alphaDataLength;
  166.  
  167.   // XXX do we copy here?  lets not...
  168.   void getAlphaData([array, size_is(length)] out PRUint8 bits, out unsigned long length);
  169.  
  170.   /**
  171.    * Sets \a length bytes of \a data in this object.
  172.    */
  173.   void setAlphaData([array, size_is(length), const] in PRUint8 data,
  174.                     in unsigned long length,
  175.                     in long offset);
  176.  
  177.   /**
  178.    * Lock alpha pixels before addressing the data directly
  179.    */
  180.   void lockAlphaData();
  181.  
  182.   /**
  183.    * Unlock alpha pixels
  184.    */
  185.   void unlockAlphaData();
  186.  
  187.  
  188.  
  189.   /* GIF Specific methods.  These should be in a different class or interface. */
  190.  
  191.   /**
  192.    * Blit this frame into another frame. Used for GIF animation compositing
  193.    */
  194.   void drawTo(in gfxIImageFrame aDst,
  195.               in PRInt32 aDX,
  196.               in PRInt32 aDY,
  197.               in PRInt32 aDWidth,
  198.               in PRInt32 aDHeight);
  199.  
  200.   /**
  201.    * Represents the number of milliseconds until the next frame should be displayed.
  202.    * @note -1 means that this frame should be displayed forever.
  203.    */
  204.   attribute long timeout;
  205.  
  206.   /* frame disposal method, used only by GIFs. Should probably subclass image frame
  207.    * and image container for GIFs special needs, but for simplicity it is here for the
  208.    * moment
  209.    */
  210.   attribute long frameDisposalMethod;
  211.  
  212.   /* frame background color
  213.    * GIF specific, should be in a GIF specific frame
  214.    */  
  215.   attribute gfx_color backgroundColor;
  216. };
  217.